home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
util
/
libs
/
ppclibemu.lha
/
README
< prev
next >
Wrap
Text File
|
1999-01-24
|
11KB
|
331 lines
---------- ppclibemu V0.5 - The ppc.library emulation for WarpOS ----------
INTRODUCTION
The PowerPC-Amiga seems to move in the direction of WarpOS, as
more and more programs are WarpOS-only.
Most prominent: StormMesa (OpenGL), Warp3D, M68k-Emulator, OS3.5(?).
Some may like it and some not. I like features in both kernels,
and in my opinion there must be a possibility to run most of the old
PowerUp software under WarpOS in future. I'm also sick of rebooting
my system, when switching the kernel. So the only solution is:
ppc.library emulation under WarpOS!
FEATURES
Since V0.5 you can start ELF objects directly (from shell or
from Workbench). The emulation library installs a LoadSeg()-patch
which detects and starts ELF objects. But in opposition to the
original library, the patch can be removed when the library is
expunged ("avail flush"). ;)
Of course you can also start ELF objects by using SAS/C's RunElf,
Ralph Schmidt's PPCLoad or vbcc's PPCRun V1.0 (PPCRun V0.9a and
older don't work, because they use the PowerUp message system).
Most important parts of the ppc.library which are still missing:
o PowerUp message system (startup messages, etc.)
o Asynchronous PowerPC tasks
o Asymchronous M68k calls
o Exception handling, debugger support
o Semaphores
o Cache functions
o Loading an ELF object from a PowerPC task
o Pooled memory has to be simulated (until powerpc.library V15 is out)
Especially mixed binary programs (and many others :) will not work.
The following functions of the original ppc.library are supported:
o PPCLoadObject
o PPCUnLoadObject
o PPCRunObject
o PPCAllocMem (MEMF_NOCACHESYNCxxx not supported)
o PPCFreeMem
o PPCAllocVec (MEMF_NOCACHESYNCxxx not supported)
o PPCFreeVec
o PPCDebugMode (private, doesn't work like the original)
o PPCCreateTask (only synchronous tasks)
o PPCGetAttrs (PPCINFOTAG_EXCEPTIONHOOK not supported)
o PPCReadLong
o PPCWriteLong
o PPCGetObjectAttrs
o PPCWriteLongFlush
o PPCReadWord
o PPCWriteWord
o PPCReadByte
o PPCWriteByte
o PPCCacheClearE
o PPCLoadObjectTagList
The following functions of the original PowerUp kernel are supported:
o PPCAdd64
o PPCAdd64p
o PPCAddHead
o PPCAddHeadSync (implementation may be incorrect)
o PPCAddTail
o PPCAddTailSync (implementation may be incorrect)
o PPCAllocMem (NOCACHESYNCM68K simulated by allocating chip RAM)
o PPCAllocPooled (No pooled mem under WOS, same as PPCAllocMem)
o PPCAllocSignal
o PPCAllocVec (NOCACHESYNCM68K simulated by allocating chip RAM)
o PPCAllocVecPooled (No pooled mem under WOS, same as PPCAllocVec)
o PPCAnd64
o PPCAnd64p
o PPCAsl64
o PPCAsl64p
o PPCAsr64
o PPCAsr64p
o PPCCallM68k (Flags ignored. Asynchronous calls are synchronous.)
o PPCCallOS (Flags ignored. Asynchronous calls are synchronous.)
o PPCClose
o PPCCloseLibrary
o PPCCmp64
o PPCCmp64p
o PPCCreatePool (No pooled mem under WOS, returns dummy)
o PPCCreateTimerObject
o PPCDeletePool (Dummy. No pooled mem under WOS)
o PPCDeleteTimerObject
o PPCDivRem64
o PPCDivRem64p
o PPCDivs64
o PPCDivs64p
o PPCDivu64
o PPCDivu64p
o PPCEnqueue
o PPCEnqueueSync (implementation may be incorrect)
o PPCFindTagItem
o PPCFindTask
o PPCFinishTask
o PPCFreeMem
o PPCFreePooled (No pooled mem under WOS, same as PPCFreeMem)
o PPCFreeSignal
o PPCFreeVec
o PPCFreeVecPooled (No pooled mem under WOS, same as PPCFreeVec)
o PPCGetAttr
o PPCGetLibSymbol
o PPCGetTagData
o PPCGetTaskAttr (PPCTASKTAG_STACKSIZE only)
o PPCGetTimerObject
o PPCInput
o PPCInsert
o PPCInsertSync (implementation may be incorrect)
o PPCLsl64
o PPCLsl64p
o PPCLsr64
o PPCLsr64p
o PPCMods64
o PPCMods64p
o PPCModu64
o PPCModu64p
o PPCMuls64
o PPCMuls64p
o PPCMulu64
o PPCMulu64p
o PPCNeg64
o PPCNeg64p
o PPCNewList
o PPCNextTagItem
o PPCOpen
o PPCOpenLibrary
o PPCOr64
o PPCOr64p
o PPCOutput
o PPCRead
o PPCRemHead
o PPCRemHeadSync (implementation may be incorrect)
o PPCRemove
o PPCRemoveSync (implementation may be incorrect)
o PPCRemTail
o PPCRemTailSync (implementation may be incorrect)
o PPCRevision
o PPCSeek
o PPCSetSignal
o PPCSetTimerObject
o PPCSignal (might not work, because of different task definitions)
o PPCSub64
o PPCSub64p
o PPCVersion
o PPCWait
o PPCWrite
o PPCXor64
o PPCXor64p
o memcpy
o strcmp
o strcpy
o strlen
o __adddi3
o __anddi3
o __ashldi3
o __ashrdi3
o __cmpdi2
o __divdi3
o __fixdfdi
o __fixsfdi
o __fixunsdfdi
o __fixunssfdi
o __floatdidf
o __floatdisf
o __floatunsdidf
o __iordi3
o __lmulq
o __lshldi3
o __lshrdi3
o __moddi3
o __muldi3
o __negdi2
o __qdivrem
o __subdi3
o __ucmpdi2
o __udivdi3
o __umoddi3
o __xordi3
Unimplemented M68k functions will return with d0=0 and PPC
functions return with r3=0.
REQUIREMENTS
o 68040 or 68060
o CyberstormPPC or BlizzardPPC
o WarpOS with powerpc.library V14+ (note that ppclibemu will
require V15 in future)
BLIZZARD PPC NOTES
You will get some problems on a BPPC with a new flash ROM, because
the original ppc.library is a resident module and will be
initialized during reset.
The only chance is to use BPPCFix and install another resident
module, which removes the ppc.library from the system before
it can initialize itself. Refer to INSTALLATION for further
informations.
Afterwards you have a 'clean' system, which allows you to start
WarpOS without using a Terminator (as on a CSPPC). Please
change the Terminator setting from '2' to '1' or '0'. WarpOS will
not work with the emulation in terminator-mode '2'.
INSTALLATION
Save your original ppc.library:
> copy libs:ppc.library libs:ppc.library.orig
Copy the ppc.library emulation from this directory to libs:
> copy ppc.library libs:
The powerpc.library has to be patched. Otherwise it will prevent
the ppc.library from opening (powerpc.library V15 will offer a
new termination mode for this purpose). The patch was tested with
powerpc.library 14.6 (16.07.98), but it should work for other
versions too:
> repl libs:powerpc.library "ppc.library\0warp" "xxx.library\0warp"
libs:powerpc.library: Replacement at 0x16820
1 replacement(s) in libs:powerpc.library.
Optionally, all these steps can be done automatically, by executing
the INSTALL script:
> execute INSTALL
Blizzard PPC owners only:
Disable the original ppc.library resident module with
> BPPCFix install
If you want to disable the original library for a longer
time, you may also put the BPPCFix into your S:Startup-Sequence:
; $VER: Startup-Sequence_HardDrive 40.2 (25.2.93)
; Startup-Sequence for hard drive systems
BPPCFix install reboot
[...]
If the fix is not already installed, it will do so and
automatically reboot the system.
Finally reboot your system to flush the old ppc.library and/or load
the patched powerpc.library.
USAGE
For a check, you might want to try the supplied test ELF object,
which was compiled by vbcc-ppc:
> hello_world.elf
Hello World!
or:
> runelf hello_world.elf
Hello World!
The other program in "tests/" is objattr_demo, a 68k program for
testing the PPCGetObjectAttrs() function. For example, you can
try to list all symbols of hello_world.elf:
> objattr_demo hello_world.elf
0x00000000 0x00000000
0x00000000 0x00000000
0x00000000 0x00000000
0x00000000 0x00000000
0x00000000 0x00000000
0x00000110 0x00000000 __error
0x000001F8 0x00000100 parse_cli_args
[...]
COMPATIBILITY
There's absolutely no problem with ELF objects generated by
vbcc-ppc, provided they don't use unsupported features like
PowerUp messaging.
I enhanced the ELF-loader in V0.4c to support common symbols.
gcc or egcs (or both?) uses them since some time, which caused
strange crashes. This was a major reason for many crashes of
earlier ppclibemu-versions by the way. Aligned memory for common
symbols is allocated in the .bss section. If no .bss section is
present, a new one will be created.
I don't have the time for testing numerous PowerUp programs,
but the following should work:
o ADoomPPC (when started by runelf, use "setenv DOOMWADDIR")
o VDoom (PPCLoad only - old startup code doesn't support runelf)
o Some demos: VAEDies and VAGhost
o musicin, musicout
o Packers: unlzx, lha, unrar, uuencode, uudecode, etc.
o Emulators: PPCFrodo, AmigaVGBPPC
o qmap
o SManPPC
o Benoit V2.0
BUGS
Most functions of ppc.library and many of the PowerUp kernel are
simply not supported, so I'm not interested in bug reports saying:
"xyz crashes, maybe it calls an unsupported function...".
If you get any difficulties (I'm sure you will :), then try to
isolate the problem by enabling the debugging mode. You can
enable debugging mode on the 68k-side by using the ppcdbmode
utility:
ppcdbmode 1 - enables all error requesters
ppcdbmode 0x8000 - enables serial debugging (you can use Sushi)
(or ppcdbmode 0x8001 to enable both).
You can get full serial debugging (kernel emulation too) by
exchanging ppc.library with ppc.library.debug.
If you think that you found a bug, then send me the last lines of
this serial debugging output, give me the name of the program and
the arguments. You should be able to determine by yourself, if it's
a real bug or only an unimplemented function which causes the problems.
For example I had crashes with AMP (MPEG movie player), because
it calls PPCGetTaskAttr() with the unsupported EXTUSERDATA tag
(a ixemul-only tag, if I understand correctly). Maybe somebody
could explain me the meaning? :)
Frank Wille 24-Jan-1999 frank@phoenix.owl.de